import socket

def get_host_ip():
    try:
        soc=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
        soc.connect(('8.8.8.8',80))
        ip=soc.getsockname()[0]
        soc.close
    except Exception as e:
        soc.close
    return ip


if __name__=="__main__":
    print(get_host_ip())